chore: Minor CLI polish.#784
Merged
Merged
Conversation
✅ Deploy Preview for viteplus-staging canceled.
|
fengmk2
approved these changes
Mar 12, 2026
Member
Author
This was referenced May 19, 2026
branchseer
added a commit
to voidzero-dev/vite-task
that referenced
this pull request
May 19, 2026
## Motivation The error-chain formatting (`error: <msg>` + `* <source>` lines, bold-red prefix) used to live in vite-plus at the napi boundary (voidzero-dev/vite-plus#784). That meant any tweak to error output — or any test that asserts on it — required building the whole vite-plus napi binding and running through the JS CLI. Moving the formatter into vite-task lets us iterate on and snapshot-test the exact user-visible error output directly with `cargo test`, no vite-plus build needed. vite-plus can then drop its napi-side formatter since `Session::main` no longer surfaces errors across the boundary — it prints them itself and returns only an exit status. ## Changes - New `vite_task::print_error(&anyhow::Error)` — writes `error: <top-level>` (bold red on TTY) plus `\n* <source>` for each link in the chain, mirroring the format vite-plus#784 introduced. - `Session::main` signature: `anyhow::Result<ExitStatus>` → `ExitStatus`. It prints errors itself via `print_error` and returns `FAILURE`; the caller just exits with the status. - `vt` binary uses `print_error` for `Session::init` errors too, so any error escaping the CLI uses the same format. - e2e snapshots updated for the new format (`Error:` → `error:`, anyhow's `Caused by:\n ...` block → `* ...` lines). vite-plus is pinned to a vite-task revision and will be updated separately to drop its napi-layer formatter. https://claude.ai/code/session_012BLuM9bhiDFBfc8U1CMst8 --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns the interactive vp command text with the new text we decided on yesterday + changes the formatting of errors coming from Vite Task: